﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="frmComplexBook.aspx.cs" Inherits="ClientSide.frmComplexReservationsaspx" Title="Complex Book" EnableEventValidation="false"%>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
 <div id="choiceFields" class="choiceFieldsComplex">
   <asp:Label ID="lblFrom" runat="server" Text="From" CssClass="label"></asp:Label>
   <asp:DropDownList ID="ddStartPoint" runat="server" CssClass="dropDown"></asp:DropDownList>
   <asp:Label ID="lblTo" runat="server" Text="То" CssClass="label"></asp:Label>
   <asp:DropDownList ID="ddEndPoint" runat="server" CssClass="dropDown"></asp:DropDownList>
   <asp:Label ID="lblDate" runat="server" CssClass="label" Text="Date"></asp:Label>
   <asp:TextBox ID="tbDate" runat="server" CssClass="tbDate"></asp:TextBox>
     <cc1:CalendarExtender ID="tbDate_CalendarExtender" runat="server" 
         Enabled="True" TargetControlID="tbDate">
     </cc1:CalendarExtender>
   <asp:Label ID="lblChoose" runat="server" Text="Sort by" CssClass="label"></asp:Label>
   <asp:DropDownList ID="ddChooseBy" runat="server" CssClass="ddChooseBy"></asp:DropDownList> 
   <asp:Button ID="btnShow" runat="server" Text="Route" class="bodyButton"/>
   <asp:RequiredFieldValidator ID="rfvDate" runat="server" ErrorMessage="Date required!" ControlToValidate="tbDate" Display="Dynamic"></asp:RequiredFieldValidator>
   <asp:Label ID="lblRequired" runat="server" CssClass="lblRequired"></asp:Label>
 </div>
 <div class="repeater">
 <div class="repColor">
 <asp:Repeater ID="outerRep" runat="server">
   <ItemTemplate>
     <div class="inRepeater">
    <asp:Repeater ID="innerRep" runat="server">
      <HeaderTemplate>
      
      </HeaderTemplate>
      <ItemTemplate>
      <div class="item">
        <div class="startHour">
          <asp:Label ID="lblStartHour" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"StartHour","{0:dd.MM HH.mm}") %>' CssClass="lblRepeater"></asp:Label>
        </div>
        <div class="segment">
          <asp:Button ID="btnRoadSegment" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"RoadSegments")%>' CssClass="lblRepeater btnDetails" ToolTip='<%#DataBinder.Eval(Container.DataItem,"DestinationName") %>' CommandArgument='<%#DataBinder.Eval(Container.DataItem,"DestinationName")+","+DataBinder.Eval(Container.DataItem,"RoadSegments") %>' OnCommand="BtnRoadSegment_Command"></asp:Button>
        </div>
        <div class="endHour">
          <asp:Label ID="lblEndHour" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"EndHour","{0:dd.MM HH.mm}")%>' CssClass="lblRepeater"></asp:Label>
        </div>
      </div>
        <br />
      </ItemTemplate>
      <HeaderTemplate>
      <div class="header">
        <div class="startHeader">
        <asp:Label ID="startHeader" runat="server" Text="Departure time"></asp:Label>
        </div>
        <div class="segmentHeader">
        <asp:Label ID="segmentHeader" runat="server" Text="Route"></asp:Label>
        </div>
        <div class="endHeader">
        <asp:Label ID="endHeader" runat="server" Text="Arrival time"></asp:Label>
        </div>
      </div>
      </HeaderTemplate>
    </asp:Repeater>
    <br /><asp:Label ID="lblPrice" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Price","Price: {0:0.00} lv") %>' CssClass="lblPrice"></asp:Label>
        <asp:Label ID="lblTime" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"TotalTime","Total time: {0} h") %>' CssClass="lblPrice"></asp:Label>
        <asp:Button ID="btnBook" runat="server" Text="Book" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"WayStationInfo") %>' OnCommand="BtnBook_Command" CssClass="bodyButton" CausesValidation="false"/>
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="bodyButton" OnCommand="BtnCancel_comand"/>
     </div>
   </ItemTemplate>
 </asp:Repeater>
 </div>
 <asp:Panel ID="panelPass" runat="server" CssClass="passFields" DefaultButton="btnConfirm">
                <div class="subPass">
                    <div class="passBtn">
                        <asp:Button ID="btnConfirm" runat="server" Text="Confirm" ValidationGroup="tbPass" OnCommand="BtnConfirm_Command" CssClass="bodyButton"/>
                    </div>
                    <div class="passTb">
                        <asp:TextBox ID="tbPassengers" runat="server" CssClass="tbPass" ValidationGroup="tbPass"></asp:TextBox>
                    </div>
                    <div class="lblPass">
                        <asp:Label ID="lblPassenegers" runat="server" Text="Passengers count"></asp:Label>
                    </div>
                    <div class="fake">
                    </div>
                </div>
  </asp:Panel>    

 <asp:RegularExpressionValidator ID="revPassengers" runat="server" ErrorMessage="The number must be one or two digit possitiv number"
                ControlToValidate="tbPAssengers" ValidationExpression="[1-9][0-9]?" ValidationGroup="tbPass" CssClass="validator">
                </asp:RegularExpressionValidator>
 <asp:RequiredFieldValidator ID="rfvPassenger" runat="server" ErrorMessage="Passenger count required"
                ControlToValidate="tbPassengers" ValidationGroup="tbPass" CssClass="validator">
                </asp:RequiredFieldValidator>
</div> 
 <asp:Panel ID="panelDetails" runat="server" CssClass="divDetails">
            <div class="row">
                <div class="destName">
                    <asp:Label ID="lblDestName" runat="server"></asp:Label>
                </div>
            </div>
            <asp:Repeater ID="repDetails" runat="server">
                <ItemTemplate>
                    <div class="row">
                        <div class="detailsN">
                            <asp:Label ID="wayStationName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Name") %>'></asp:Label>
                        </div>
                        <div class="details">
                            <asp:Label ID="wayStationPrice" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Price",
              "{0:0.00}") %>'></asp:Label>
                        </div>
                        <div class="details">
                            <asp:Label ID="wayStationTime" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Time") %>'></asp:Label>
                        </div>
                        <div class="details">
                            <asp:Label ID="wayStationStay" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Stay") %>'></asp:Label>
                        </div>
                    </div>
                </ItemTemplate>
                <HeaderTemplate>
                    <div class="row">
                        <div class="detHeaderN">
                            <asp:Label ID="lblDetName" runat="server" Text="Name"></asp:Label>
                        </div>
                        <div class="detHeader">
                            <asp:Label ID="lblDetPrice" runat="server" Text="Price*"></asp:Label>
                        </div>
                        <div class="detHeader">
                            <asp:Label ID="lblDetTime" runat="server" Text="Time*"></asp:Label>
                        </div>
                        <div class="detHeader">
                            <asp:Label ID="lblDetStay" runat="server" Text="Stay"></asp:Label>
                        </div>
                    </div>
                </HeaderTemplate>
            </asp:Repeater>
        </asp:Panel>
        <div class="roww">
            <asp:Label ID="lblNote" runat="server" Text="* From the previous station."></asp:Label>
        </div>
        <div class="lblBookNote">
          <asp:Label ID="lblBookNote" runat="server"></asp:Label>
        </div>
</asp:Content>
